﻿<Window x:Class="Tool12306.AutoOrderWindow2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:src="clr-namespace:Tool12306"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        Title="自动订票工具" Height="600" Width="800" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <src:NumColorConvertor x:Key="ncc"/>
        <src:NumTextConvertor x:Key="ntc"/>
        <src:NumEnableConvertor x:Key="nec"/>
    </Window.Resources>
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5,5,5,0">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="发车站:" VerticalAlignment="Center" Margin="5,0,0,0"/>
                        <TextBox Name="_ctlListStartStation" Width="120" Text="北京西"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="到达站:" VerticalAlignment="Center" Margin="5,0,0,0"/>
                        <TextBox Name="_ctlListToStation" Width="120" Text="重庆"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="发车时间:" VerticalAlignment="Center" Margin="5,0,0,0"/>
                        <DatePicker Name="_ctlDateStartDate" />
                        <Button Content="查看车次" Name="_ctlBtnSearch" Click="_ctlBtnSearch_Click" Margin="5,0,0,0" Padding="5,0,5,0" />
                    </StackPanel>
                </StackPanel>
                <Grid Grid.Row="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0" Margin="5,5,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0">
                            <TextBlock Text="选择座位类型" FontSize="15" FontWeight="Bold" FontFamily="Microsoft YaHei" Background="#F04EBDC4" Foreground="White" Padding="5" />
                        </Border>
                        <ListBox Name="_ctlListSeat" Grid.Row="1" VerticalAlignment="Stretch" MinHeight="50" IsManipulationEnabled="False" SelectionMode="Single" BorderThickness="0">
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="{x:Type ListBoxItem}">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                                <RadioButton Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
              IsChecked="{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ListBox.ItemContainerStyle>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding caption}" FontSize="14" FontFamily="Microsoft YaHei"/>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                    <Grid Grid.Column="1" Margin="5,5,0,5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0">
                            <TextBlock Text="选择乘车人" FontSize="15" FontWeight="Bold" FontFamily="Microsoft YaHei" Background="#F04EBDC4" Foreground="White" Padding="5"/>
                        </Border>
                        <ListBox Name="_ctlListPassenger" Grid.Row="1" VerticalAlignment="Stretch" IsManipulationEnabled="False" SelectionMode="Multiple" BorderThickness="0">
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="{x:Type ListBoxItem}">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                                <CheckBox Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
              IsChecked="{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ListBox.ItemContainerStyle>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding passenger_name}"/>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                    <Grid Grid.Column="2" Margin="5,5,5,5">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0">
                            <TextBlock Grid.Row="0" Text="选择列车" FontSize="15" FontWeight="Bold" FontFamily="Microsoft YaHei" Background="#F04EBDC4" Foreground="White" Padding="5" />
                        </Border>
                        <ListBox Name="_ctlListTrain" Grid.Row="1" BorderThickness="0" VerticalAlignment="Stretch" MinHeight="50" IsManipulationEnabled="False" SelectionMode="Single">
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="{x:Type ListBoxItem}">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                                <ContentControl Content="{TemplateBinding Content}"
              ContentTemplate="{TemplateBinding ContentTemplate}"
              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" HorizontalContentAlignment="Stretch"/>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </ListBox.ItemContainerStyle>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <Button Name="_ctlBtnOrdering" Click="_ctlBtnOrdering_Click" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="5,5,5,0">
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                                <TextBlock Text="{Binding TrainName}"/>
                                                <TextBlock Text="("/>
                                                <TextBlock Text="{Binding StartCity}"/>
                                                <TextBlock Text="-"/>
                                                <TextBlock Text="{Binding ArriveCity}"/>
                                                <TextBlock Text=")"/>
                                            </StackPanel>
                                        </Button>
                                        <!--<Button Name="_ctlBtnOrdering2" Click="_ctlBtnOrdering2_Click" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="5,5,5,0">
                                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                                                <TextBlock Text="暴力购买:"/>
                                                <TextBlock Text="{Binding TrainName}"/>
                                                <TextBlock Text="("/>
                                                <TextBlock Text="{Binding StartCity}"/>
                                                <TextBlock Text="-"/>
                                                <TextBlock Text="{Binding ArriveCity}"/>
                                                <TextBlock Text=")"/>
                                            </StackPanel>
                                        </Button>-->
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </Grid>
            </Grid>
            <StatusBar Grid.Row="1" Height="23" Name="statusBar1">
                <TextBlock Name="_ctlStatusMessage" Text="status message"/>
                <StatusBarItem HorizontalAlignment="Right">
                    <Hyperlink IsEnabled="False">
                        <TextBlock Text="发送错误报告"/>
                    </Hyperlink>
                </StatusBarItem>
            </StatusBar>
        </Grid>
        <Border Name="_borderMask" Background="#A5000000" Visibility="Collapsed">
            <Border CornerRadius="5" BorderThickness="5" BorderBrush="#FFFFC300" HorizontalAlignment="Center" Background="#FFFFC300" VerticalAlignment="Center" Opacity="0.9">
                <Border CornerRadius="5" BorderBrush="White" BorderThickness="5" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Grid Background="White">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Image Grid.Column="0" Source="/Tool12306;component/Resources/WAITE.jpg" Width="200" Height="200" Stretch="UniformToFill"/>
                        <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="250" Margin="-30,0,0,0">
                            <TextBlock Text="订购中..." FontSize="24" FontWeight="Bold" Margin="5" HorizontalAlignment="Center" FontFamily="Microsoft Yahei,NSimSun" />
                            <TextBlock Name="_ctlTextLog" Text="消息" HorizontalAlignment="Center" FontSize="18" Margin="5"/>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <TextBlock Text="已尝试" FontSize="18"/>
                                <TextBlock Name="_ctlTextTry" Text="x" FontWeight="Bold" FontSize="18" Margin="5,0,5,0"/>
                                <TextBlock Text="次!" FontSize="18"/>
                            </StackPanel>
                            <Button Name="_ctlBtnCancel" Content="取消" Click="_ctlBtnCancel_Click" Margin="10" Height="30"/>
                        </StackPanel>
                    </Grid>
                </Border>
            </Border>
        </Border>
    </Grid>
</Window>
